//
//  Utils.h
//  moon
//
//  Created by beyself on 16/6/6.
//  Copyright © 2016年 beyself. All rights reserved.
//
#import "GlobelDefines.h"
#import "AppDelegate.h"
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface Utils : NSObject
+ (NSString *)ToHex:(uint16_t)tmpid;
+ (NSString *)md5:(NSString *)str;
+ (void) saveCustomObject:(NSObject *)obj key:(NSString*)key;
+ (NSObject *)loadCustomObjectWithKey:(NSString *)key;
+ (UIImage *) imageFromColor:(UIColor *)color;
+ (void) sendHttpPost:(NSMutableDictionary*)param method:(NSString*)method controller:(UIViewController*)controller flag:(int)flag;
+ (void) sendHttpPostNOWait:(NSMutableDictionary*)param method:(NSString*)method controller:(UIViewController*)controller flag:(int)flag;
+ (void) sendHttpLogin;
+ (void) sendHttpGet:(NSMutableDictionary*)param method:(NSString*)method controller:(UIViewController*)controller;
+ (BOOL) isStringNullOrEmpty:(NSObject*)obj;
+ (UIImage*)imageWithImageSimple:(UIImage*)image scaledToSize:(CGSize)newSize;
+ (void) saveDefaultUser:(NSString*)obj key:(NSString*)key;
+ (NSString*) readDefaultUser:(NSString*)key;
+ (NSString*) date2String:(NSDate*) date format:(NSString*)format;
+ (NSDate*) string2Date:(NSString*) date format:(NSString*)format;
+ (NSString*) date2format:(NSString*)date;
+(UIImage *) imageCompressForWidth:(UIImage *)sourceImage targetWidth:(CGFloat)defineWidth;
@end
